<template>
  <div :class="{'theme-market': showMarketingBar}">
    <section :class="dataInfo.sales || isBargain?'c-bd-b1': (couponList && couponList.length > 0) ? '' : 'c-bd-b10'">
      <div class="c-p c-w100">
        <vip-custom-img :cover="cover" :prodType="isSales || isFa ? (vipInfo.vipType == 2 ? 1 : vipInfo.vipType == 4 ? 23 : -1) : dataInfo.prodType" :fontClass="{
          boxStyle: 'c-pv80 c-pl36',
          name: 'c-fs48 c-pt60 c-text-ellipsis1 c-fw-b',
          duration: 'c-fs36 c-pb60'}" :isBigImg="true" :content="{name: vipInfo.name, duration: vipInfo.duration, durationType: vipInfo.durationType}" />
      </div>
      <!-- 营销活动倒计时 -->
      <flash-sales-time-new
        v-if="showMarketingBar"
        :type="dataInfo.sales? 'isSale':isFa ? 'isFa' : isBargain ? 'isBargain' : 'isCollage'"
        :from="isCollage && dataInfo.collageGroupType == 2 ? 'activity' : ''"
        :price="dataInfo.sales ? dataInfo.price : isCollage ? dataInfo.captainPrice : isBargain ? dataInfo.reservePrice : ''"
        :startTime="dataInfo.sales ? dataInfo.sales.startTime : isBargain ? dataInfo.startTime : isCollage ? dataInfo.startTime : dataInfo.startAt"
        :endTime="dataInfo.sales ? dataInfo.sales.endTime : isBargain ? dataInfo.endTime : isCollage ? dataInfo.endTime : dataInfo.endAt"
        :originalPrice="dataInfo.sales ? (vipInfo ? vipInfo.price : '') : isFa ? dataInfo.vipPrice : dataInfo.prodPrice"
        :stock="dataInfo.sales ? dataInfo.balance: ''"
        :stockBargain="isBargain && dataInfo.stock"
        :isLimit="dataInfo.sales && dataInfo.limit == 0 || (isBargain && dataInfo.isLimitStock == 2) ? false : true"
        :salesTag="dataInfo.sales && dataInfo.sales.tags"
        :peopleNum="isCollage && dataInfo.peopleNum"
        :isPreheat="isBargain && dataInfo.isPreheat"
        :bargainStatus="isBargain && dataInfo.status"
        @showCoupon="showCoupon = true"
        @falshSalesTime="falshSalesTime"
        @finishFlashSales="finishFlashSales">
      </flash-sales-time-new>
      <div class="c-flex-column c-pv24 c-ph24">
        <div class="c-flex-row c-aligni-center c-box">
          <span class="c-fs30 c-fc-xblack c-fw-n">{{isCollage ? vipInfo.name : isBargain ? dataInfo.prodName : isSales ?vipInfo.prodName : dataInfo.name}}</span>
        </div>
        <span v-if="!isSales && !isCollage && !isBargain" class="theme-fc c-fs36 c-mt20">{{'￥' | iosPriceFilter('Member')}}{{isCollage ? dataInfo.prodPrice : isBargain ? dataInfo.prodPrice : isSales ? vipInfo.vipPrice : dataInfo.vipPrice}}</span>
      </div>
    </section>
    <discount-tip :couponList="couponList"
      @clickShowCoupon="showCoupon = true"
      :deductiblePoints="vipInfo.deductiblePoints"
      :isMarketing="false"
      :hasPermission='false'
      :showDiscount="true"
      :sales="dataInfo.sales"
      class="c-bd-b10"
      v-if="couponList.length > 0 || (vipInfo.deductiblePoints && vipInfo.deductiblePoints > 0)"
    ></discount-tip>
    <collage-persons-list v-if="isCollage && dataInfo && (dataInfo.collageGroup && dataInfo.isCollageOnline == 1 || dataInfo.status != 2)" class="c-ph24 c-bd-b10" :collage="dataInfo" @goCollageDetail="gcd"></collage-persons-list>
    <bargain-rules v-if="isBargain && !dataInfo.hasPermission" :isPreheat="dataInfo.isPreheat" :status="dataInfo.status" class="c-bd-b12-f5 c-bd-t12-f5"></bargain-rules>
    <!-- 赠送实物、积分、优惠券信息 -->
    <section class="c-ph24 c-bd-b10 c-pb30" v-if="vipInfo.isFreeGood == 1">
      <div class="c-mt40">
        <div class="c-fs28 c-fw-b c-fc-xblack">获得礼品</div>
        <div class="c-mb32 c-w100 c-contexty-hidden c-contextX-scroll c-ws-n c-hh200">
          <template v-if="vipInfo.giftRelates && vipInfo.giftRelates.length > 0">
            <div class="c-inlineblack c-mr30" @click="showGoodsList">
              <div class="c-ww170 c-hh200 c-flex-row c-aligni-end c-p">
                <div class="c-ww170 c-hh150 c-p-l0 c-pa" :class="vipInfo.giftRelates[0].relateCover?'c-p-b30':'c-p-b40'">
                  <div class="c-ww170 c-hh150 c-p">
                    <img class="c-hh140 c-pa c-p-b0" :class="vipInfo.giftRelates[0].relateCover?'c-ww150 c-br10 c-p-l10 box-shadow':'c-ww170 c-p-l0'" :src="$addXossFilter(vipInfo.giftRelates[0].relateCover, 'https://knowledge-payment.oss-cn-beijing.aliyuncs.com/goodsBanners/2020-04-07/mrgYje6xWQyxXzihm3rf9o7SnFMbGy767nmCfzF1.png')">
                  </div>
                </div>
                <div class="c-ww170 c-hh70 c-p-b0 c-p-l0 c-pa">
                  <div class="c-ww170 c-hh70 c-flex-row c-aligni-end c-p">
                    <div class="c-fc-white c-ww170 translate-lr c-ph10 c-p-t24">
                      <p class="c-fs24 c-textAlign-c c-text-ellipsis1 c-w100">实物赠品</p>
                    </div>
                    <img class="c-ww170 c-hh70" :src="$addXossFilter('https://knowledge-payment.oss-cn-beijing.aliyuncs.com/goodsBanners/2020-04-07/wqNIQ6OI5heuhir1CogAB6fq7HAAOs3c41KHOGn6.png')">
                  </div>
                </div>
                <img class="c-ww170 c-hh140" :src="$addXossFilter('https://knowledge-payment.oss-cn-beijing.aliyuncs.com/goodsBanners/2020-04-07/wtKTBhfHjWL6OByKSYLQlKNdo2jbkr637D7z4od5.png')">
              </div>
            </div>
          </template>
          <template v-else>
            <div class="c-inlineblack c-mr30" @click="getGoodsDetail()">
              <div class="c-ww170 c-hh200 c-flex-row c-aligni-end c-p">
                <div class="c-ww170 c-hh150 c-p-l0 c-pa" :class="vipInfo.freeGoodImg?'c-p-b30':'c-p-b40'">
                  <div class="c-ww170 c-hh150 c-p">
                    <img class="c-hh140 c-pa c-p-b0" :class="vipInfo.freeGoodImg?'c-ww150 c-br10 c-p-l10 box-shadow':'c-ww170 c-p-l0'" :src="$addXossFilter(vipInfo.freeGoodImg, 'https://knowledge-payment.oss-cn-beijing.aliyuncs.com/goodsBanners/2020-04-07/mrgYje6xWQyxXzihm3rf9o7SnFMbGy767nmCfzF1.png')">
                  </div>
                </div>
                <div class="c-ww170 c-hh70 c-p-b0 c-p-l0 c-pa">
                  <div class="c-ww170 c-hh70 c-flex-row c-aligni-end c-p">
                    <div class="c-fc-white c-ww170 translate-lr c-ph10 c-p-t24">
                      <p class="c-fs24 c-textAlign-c c-text-ellipsis1 c-w100">{{vipInfo.freeGoodName}}</p>
                    </div>
                    <img class="c-ww170 c-hh70" :src="$addXossFilter('https://knowledge-payment.oss-cn-beijing.aliyuncs.com/goodsBanners/2020-04-07/wqNIQ6OI5heuhir1CogAB6fq7HAAOs3c41KHOGn6.png')">
                  </div>
                </div>
                <img class="c-ww170 c-hh140" :src="$addXossFilter('https://knowledge-payment.oss-cn-beijing.aliyuncs.com/goodsBanners/2020-04-07/wtKTBhfHjWL6OByKSYLQlKNdo2jbkr637D7z4od5.png')">
              </div>
            </div>
          </template>
        </div>
      </div>
    </section>
    <section class="c-bd-b10" v-if="dataInfo.options != null && dataInfo.options.length > 0">
      <div class="c-bg-white c-pb20 c-pt36" v-if="(isCollage && (dataInfo.prodType == cfrom.collageVip || dataInfo.prodType == cfrom.vip)) || (isBargain && (dataInfo.prodType == cfrom.vip)) || (isSales && vipInfo.vipType == 2) || (isFa && dataInfo.vipType == 2)">
        <!-- <div class="c-textAlign-c c-pt24 c-flex-row c-flex-center">
          <img src="@/assets/icon_vip_left.png" alt="" class="icon-vip34">
          <span class="c-fs32 theme-fc c-ph24">VIP会员</span>
          <img src="@/assets/icon_vip_right.png" alt="" class="icon-vip34">
        </div>
        <div class="theme-fc c-textAlign-c c-fs20 c-pb20 c-bd-b1 c-pt12 c-ph24 c-mb20">你将享受如下特权</div> -->
        <div class="c-fs28 c-fw-b c-fc-xblack c-ph24">会员权益说明</div>
        <div class="c-flex-row c-aligni-center c-ph24 c-mt24" :class="index == dataInfo.options.length ? 'c-pb40' : 'c-pb20'" v-for="(item,index) in dataInfo.options" :key="index">
          <span class="vip-circle theme-bg"></span>
          <span class="c-pl16 c-fs24">{{item}}</span>
        </div>
      </div>

      <div class="c-bg-white c-pb20 c-pt36" v-if="(isCollage && (dataInfo.prodType == cfrom.collageSvip || dataInfo.prodType == cfrom.svip)) || (isBargain && (dataInfo.prodType == cfrom.svip)) || (isSales && vipInfo.vipType == 4) || (isFa && dataInfo.vipType == 4)">
        <!-- <div class="c-textAlign-c c-pt24 c-flex-row c-flex-center">
          <img src="@/assets/icon_vip_left.png" alt="" class="icon-vip34">
          <span class="c-fs32 theme-fc c-ph24">SVIP会员</span>
          <img src="@/assets/icon_vip_right.png" alt="" class="icon-vip34">
        </div>
        <div class="theme-fc c-textAlign-c c-fs20 c-pb20 c-bd-b1 c-pt12 c-ph24 c-mb20">你将享受如下特权</div> -->
        <div class="c-fs28 c-fw-b c-fc-xblack c-ph24">会员权益说明</div>
        <div class="c-flex-row c-aligni-center c-ph24 c-mt24" :class="index == dataInfo.options.length ? 'c-pb40' : 'c-pb20'" v-for="(item,index) in dataInfo.options" :key="index">
          <span class="vip-circle theme-bg"></span>
          <span class="c-pl16 c-fs24">{{item}}</span>
        </div>
      </div>
    </section>
    <section class="" v-if="equityDetail && equityDetail.length > 0">
      <div class="c-bg-white c-pb20 c-pt36 c-ph24">
        <div class="c-fs28 c-fw-b c-fc-xblack">权益详情</div>
        <course-description ref="equityDetail"></course-description>
      </div>
    </section>

    <bottom-buy-com
      :ckFrom="1"
      :showMarketingCard="isCollage || isFa || dataInfo.sales || isBargain"
      :showFriendHelper="isFa || isBargain"
      :friendHelperStatus="dataInfo.status == 1 ? 2 : 1"
      :showBuyButton="isCollage || dataInfo.sales || isBargain"
      @invitePoster="invitePoster"
      @goHelpDetail="goHelpDetail"
    >
      <template v-if="isCollage">
        <div class="c-pv16 c-fs28 theme-fc c-ph40 c-br36 c-textAlign-r" v-if="dataInfo.status == 2 && dataInfo.userType != -1 && dataInfo.payStatus == 1" @click="goCollageDetail(dataInfo.groupId,dataInfo.collageId)">
          拼团中...
        </div>
        <div class="c-mr24 c-pv16 c-fs28 theme-fc c-ph40 c-br36 theme-bd1 c-textAlign-r" v-if="dataInfo.status == 2 && dataInfo.userType != -1 && dataInfo.payStatus == 2" @click="goCollageDetail(dataInfo.groupId,dataInfo.collageId)">
          拼团成功
        </div>
        <div class="c-flex-row c-justify-end c-hh64 c-w0 c-flex-grow1" v-if="(dataInfo.status == 2 || dataInfo.status == 1) && ((dataInfo.userType != -1 && dataInfo.payStatus < 1) || (dataInfo.userType == -1)) && dataInfo.userIdentity != 3 && dataInfo.userIdentity != 5 && dataInfo.userIdentity != 6 && dataInfo.userIdentity != 7 && dataInfo.userIdentity != 8 && !isVipFoever()">
          <div class="c-flex-column c-aligni-center c-justify-sa theme-fc theme-bd1 c-ww196 c-br32 c-mr10" @click="goVipUp()">
            <span v-if="!isChainProd" class="c-fs22 c-lh">{{'￥' | iosPriceFilter('Member')}}{{dataInfo.prodPrice}}</span>
            <span class="c-fs20 c-lh">{{isChainProd ? '直接' : '原价'}}购买</span>
          </div>
          <div class="c-flex-column c-aligni-center c-justify-sa c-fc-white c-ww196 c-br32" :class="dataInfo.status == 1 ? 'c-bg-d7' : 'theme-bg-gradient'" @click="goBuy(-1,dataInfo.collageId)">
            <span class="c-fs22 c-lh">{{'￥' | iosPriceFilter('Member')}}{{dataInfo.captainPrice}}</span>
            <span class="c-fs20 c-lh">发起拼团</span>
          </div>
        </div>
        <div v-if="(dataInfo.status == 1 || dataInfo.status == 2)&& (dataInfo.userIdentity == 3 || dataInfo.userIdentity == 5 || dataInfo.userIdentity == 6 || dataInfo.userIdentity == 7 || dataInfo.userIdentity == 8) || isVipFoever()" class="c-fs28 c-lh c-fc-white c-flex-row c-aligni-center c-flex-center theme-bg c-pv16 c-br36 c-flex-grow1 c-mh20">
          您已享受特权
        </div>
      </template>
      <template v-if="isBargain">
        <div class="c-flex-row c-justify-end c-hh64 c-w100 c-flex-grow1" v-if="((dataInfo.status == 1 && dataInfo.isPreheat == 1) || dataInfo.status == 2) && ((dataInfo.userType != -1) || (dataInfo.userType == -1)) && dataInfo.userIdentity != 3 && dataInfo.userIdentity != 5 && dataInfo.userIdentity != 6 && dataInfo.userIdentity != 7 && dataInfo.userIdentity != 8 && !isVipFoever()">
          <div class="c-flex-column c-aligni-center c-justify-sa theme-fc theme-bd1 c-w50 c-br32 c-mr10" @click="goVipUp()">
            <span v-if="!isChainProd" class="c-fs22 c-lh">{{'￥' | iosPriceFilter('Member')}}{{Number(dataInfo.prodPrice).toFixed(2)}}</span>
            <span class="c-fs20 c-lh">{{isChainProd ? '直接' : '原价'}}购买</span>
          </div>
          <!-- 未发起砍价 -->
          <template v-if="dataInfo.userType == 1">
            <div class="c-flex-row c-flex-center c-fc-white c-hh64 c-w50 c-fs28 c-br32 theme-bg-gradient" @click="handleClickBargainDetail(dataInfo.bargainId)">正在砍价</div>
          </template>
          <template v-if="dataInfo.userType == -1">
            <div class="c-flex-column c-aligni-center c-justify-sa c-fc-white c-w50 c-br32" :class="(dataInfo.status == 1 && dataInfo.isPreheat == 1) ? 'c-bg-d7' : 'theme-bg-gradient'" @click="handleClickBargainDetail(dataInfo.bargainId)">
              <span class="c-fs22 c-lh">{{'￥' | iosPriceFilter('Member')}}{{Number(dataInfo.reservePrice).toFixed(2)}}</span>
              <span class="c-fs20 c-lh">砍价享</span>
            </div>
          </template>
        </div>
        <div v-if="(dataInfo.status == 1 || dataInfo.status == 2)&& (dataInfo.userIdentity == 3 || dataInfo.userIdentity == 5 || dataInfo.userIdentity == 6 || dataInfo.userIdentity == 7 || dataInfo.userIdentity == 8) || isVipFoever()" class="c-fs28 c-lh c-fc-white c-flex-row c-aligni-center c-flex-center theme-bg c-pv16 c-br36 c-flex-grow1">
          您已享受特权
        </div>
      </template>
      <template v-if="isFa">
        <div class="c-flex-row c-hh64 c-w0 c-flex-grow1 c-justify-end" v-if="dataInfo.status == 1 && (dataInfo.userType != 3 && dataInfo.userType != 5 && dataInfo.userType != 6) && !isVipFoever()">
          <div class="c-flex-column c-aligni-center theme-fc c-justify-sa theme-fc theme-bd1 c-ww196 c-br32 c-mr10" @click="goVipUp()">
            <span v-if="!isChainProd" class="c-fs22 c-lh">{{'￥' | iosPriceFilter('Member')}}{{dataInfo.vipPrice}}</span>
            <span class="c-fs20 c-lh">{{isChainProd ? '直接' : '原价'}}购买</span>
          </div>
          <div class="c-flex-column c-flex-center c-fc-white c-ww196 c-br32" :class="dataInfo.status == 1 ? 'theme-bg-gradient' : 'c-bg-d7'" @click="goHelpDetail">
            <span class="c-fs26 c-lh">灌溉领取</span>
          </div>
        </div>
        <div v-if="(dataInfo.status == 1 || dataInfo.status == 2)&& (dataInfo.userType == 3 || dataInfo.userType == 5 || dataInfo.userType == 6) || isVipFoever()" class="c-fs28 c-lh c-fc-white c-flex-row c-aligni-center c-flex-center theme-bg c-pv16 c-br36 c-flex-grow1">
          您已享受特权
        </div>
      </template>
      <template v-if="dataInfo.sales">
        <div @click="buyOnSales" v-if="dataInfo.sales.status == 2 && (dataInfo.userType != 3 && dataInfo.userType != 5 && dataInfo.userType != 6) && !isVipFoever()" class="c-fs28 c-lh c-fc-white c-flex-row c-flex-center theme-bg-gradient c-hh64 c-br36 c-flex-grow1">
          立即抢购
        </div>
        <div v-if="dataInfo.sales.status == 1" class="c-fs28 c-lh c-fc-white c-flex-row c-flex-center c-bg-d7 c-hh64 c-br36 c-flex-grow1">
          活动未开始
        </div>
        <div v-if="dataInfo.sales.status == 2 && (dataInfo.userType == 3 || dataInfo.userType == 5 || dataInfo.userType == 6) || isVipFoever()" class="c-fs28 c-lh c-fc-white c-flex-row c-flex-center theme-bg c-hh64 c-br36 c-flex-grow1">
          您已享受特权
        </div>
      </template>
    </bottom-buy-com>

    <!-- 实体商品详情 -->
    <cj-popup v-model="isShowGoodsDetail" round>
      <article class="c-ww520 c-textAlign-c">
        <div class="c-fs28 c-fc-sblack c-mb24 c-mt40 c-fw-b">{{vipInfo.freeGoodName}}</div>
        <div class="c-mb40 c-ph40 c-maxh400 c-contexty-scroll c-contextX-hidden c-ws-n">
          <div class="goodsDetail" v-html="vipInfo.freeGoodDesc"></div>
        </div>
        <div class="c-flex-row c-w100 c-aligni-center c-justify-center c-mb30">
          <div @click="isShowGoodsDetail = false" class="c-fs22 c-fc-white c-ww220 c-hh50 c-flex-row c-aligni-center c-justify-center c-br30 knowBtn">
            <div>我知道了</div>
          </div>
        </div>
      </article>
    </cj-popup>
    <offical-account v-if="dataInfo && isBargain" :showAccountQcode="showAccountQcode" :desc="officalDesc" :imgSrc="$addXossFilter(mpQrcode)" @hideDialog="hideDialog"></offical-account>
    <coupon-list-com @closeModal="showCoupon = false"
      @getCouponList="getCouponList"
      :couponIsPage="couponIsPage"
      :couponLoading="couponLoading"
      :couponList="couponList"
      :deductiblePoints="Number(vipInfo.deductiblePoints)"
      :showCoupon="showCoupon"
      :sales="dataInfo.sales"
    ></coupon-list-com>
    <collage-grades ref="collageGrades" :refereeId="refereeId" :isRelForm="dataInfo.isRelForm && !dataInfo.hasFormLog" :bindPhoneSetting="bindPhoneSetting" :goodsRoomId="goodsRoomId" :recRelateId="recRelateId" :recType="recType" :dataInfo="dataInfo"></collage-grades>
    <cj-popup round v-model="isShowGoodsList" class="c-bg-transparent">
      <div class="c-ww520" v-if="vipInfo.isFreeGood == 1 && vipInfo.giftRelates && vipInfo.giftRelates.length > 0">
        <img class="c-w100" src="../../../assets/i/wap/vip/vip-good-top.png" alt="">
        <div class="dialog-mid c-w100">
          <div class="c-w100 c-ph40 c-maxh400 c-contexty-scroll">
            <!-- 实物赠送 -->
            <div v-for="(item, index) in vipInfo.giftRelates" :key="index" :class="index == vipInfo.giftRelates.length - 1 ? '' : 'c-mb20'" class="c-bg-white c-hh120 c-flex-row c-w100 c-br16 c-text-hidden">
              <div class="c-h c-ww124 c-flex-shrink0 c-flex-column c-justify-sb c-aligni-center c-fc-white c-p">
                <img class="c-w100 c-h" :src="$addXossFilter(item.relateCover, '../../../assets/defult270.png')" />
                <div v-if="item.stock == 0" class="c-fs24 c-fc-white c-translucent-balck70 c-h c-w100 c-pa c-p-l0 c-p-t0 c-pz9 c-flex-row c-flex-center">补货中</div>
              </div>
              <div class="c-flex-grow1 c-w0 c-flex-row c-justify-sb c-aligni-center c-ph14 c-pv16">
                <div class="c-flex-grow1 c-w0 c-flex-column c-justify-sb c-textAlign-l">
                  <div class="c-fs24 c-fw600 c-fc-xblack c-text-ellipsis1">{{item.relateName != null ? item.relateName :'实体商品'}}</div>
                </div>
                <div class="c-ww100 c-hh40 c-br20 c-fs22 c-fc-white c-flex-row c-flex-center c-flex-shrink0 c-ml24" @click="goShopDetail(item)" style="background: #AF7246;">查看</div>
              </div>
            </div>
          </div>
        </div>
        <div class="dialog-bottom c-w100 c-pt100">
          <img @click="isShowGoodsList = false" class="c-ww360 c-hh76 c-mlr-auto" src="../../../assets/i/wap/vip/confirm-btn.png" alt="">
        </div>
      </div>
    </cj-popup>
  </div>
</template>

<script>
import FlashSalesTimeNew from "@/components/templates/flashSalesTimeNew.vue";
import VipCustomImg from "@/components/templates/common/VipCustomImg.vue";
import { utilJs } from "@/utils/common.js";
import CollagePersonsList from "@/components/templates/collage/collagePersonsList.vue";
import BottomBuyCom from "@/components/templates/common/bottomBuyCom.vue";
import bargainRules from '@/components/templates/bargain/bargainRules';
import officalAccount from '@/components/templates/common/officalAccount';
import DiscountTip from "@/components/templates/common/discountTip.vue";
import couponListCom from "@/components/templates/couponListCom.vue";
import courseDescription from '@/components/templates/courseDescription';
import { getBindPhoneSetting } from "@/utils/checkUnBindPhone.js";
import collageGrades from "@/components/templates/collage/collageGrades.vue";
const THEME_RGB_MAP = {
  'mb5_default': '255, 113, 0',
  'mb4_default': '255, 48, 12',
  'mb3_orange': '254, 153, 1',
  'mb3_blue': '0, 153, 255',
  'mb3_ruby': '214, 8, 8',
  'mb3_green': '1, 204, 0',
  'mb3_blown': '151, 104, 0',
  'mb6_default': '36, 138, 253',
  'mb7_blue': '22, 150, 255',
  'mb7_drakBlue': '57,63,81',
  'mb7_orange': '239,124,56',
  'mb7_purple': '110,65,242',
  'mb7_pink': '247,65,99',
  'mb7_blown': '151,104,0',
  'mb7_black': '51,51,51',
  'mb7_green': '48,182,86',
  'mb7_ruby': '214,8,8',
  'mb8_blue': '22, 150, 255',
  'mb8_drakBlue': '57,63,81',
  'mb8_orange': '239,124,56',
  'mb8_purple': '110,65,242',
  'mb8_pink': '247,65,99',
  'mb8_blown': '151,104,0',
  'mb8_black': '51,51,51',
  'mb8_green': '48,182,86',
  'mb8_ruby': '214,8,8',
};
export default {
  name: "ImgText",
  components: {
    VipCustomImg,
    FlashSalesTimeNew,
    CollagePersonsList,
    BottomBuyCom,
    bargainRules,
    officalAccount,
    DiscountTip,
    couponListCom,
    courseDescription,
    collageGrades
  },
  props: [],
  beforeCreate() { },
  data() {
    return {
      cfrom: global.ckFrom,
      theme: localStorage.getItem("colorName") ? localStorage.getItem("colorName") : 'mb5_default',
      companyAuth: JSON.parse(localStorage.getItem("companyAuth")),
      prodId: -1,
      cover: null, //封面背景
      dataInfo: {},
      collageList: [],
      is_collagePage: false,
      collagePage: 1,
      vipInfo: '',
      isSales: false, //true：限时购
      isCollage: false,
      isBargain: false,
      buyStatus: 1,
      limitSale: 0,
      isShowGoodsDetail: false,
      mkType: '',
      showAccountQcode: false,
      officalDesc: '关注我们后才可发起砍价哦',
      mpQrcode: '', //二维码
      couponList: [],
      couponPage: 1,
      couponIsPage: false,
      couponLoading: false,
      showCoupon: false,
      redeemType: '',
      bindPhoneSetting: null,
      equityDetail: [],
      isChainProd: false,
      recRelateId: '',
      recType: '',
      isShowGoodsList: false // 显示礼包实体商品列表（原来只能添加一个自定义商品，后改为可从商城中选多个，所以改成弹框展示）
    };
  },
  created() {
    utilJs.appShare(this);
  },
  mounted() { },
  computed: {
    showMarketingBar() {
      return this.dataInfo &&
        (
          this.dataInfo.sales ||
          (this.isBargain && ((this.dataInfo.status == 1 && this.dataInfo.isPreheat == 1) || this.dataInfo.status == 2)) ||
          (this.isCollage && (this.dataInfo.status == 2 || this.dataInfo.status == 1)) ||
          (this.isFa && (this.dataInfo.status == 2 || this.dataInfo.status == 1))
        )
    }
  },
  watch: {},
  methods: {
    showGoodsList() {
      this.isShowGoodsList = true;
    },
    goShopDetail(goodsInfo) {
      this.$routerGo(this, "push", {
        path: '/mall/shopDetail/shopDetail',
        query: {
          shopNo: goodsInfo.relateId
        }
      })
    },
    //权益详情
    getEquityDetail(vipT) {
      utilJs.getMethod(global.apiurl + "Marketing/vip/getEquityDetail?prodType=" + vipT, res => {
        this.equityDetail = res;
        this.$nextTick(() => {
          this.$refs.equityDetail.getDescriptInfo(this.equityDetail ? this.equityDetail : []);
        })
      })
    },
    hideDialog() {
      this.showAccountQcode = false;
    },
    // 判断是否关注公众号
    checkUserIsFollowedMp() {
      let _this = this;
      return new Promise(function (resolve, reject) {
        utilJs.getMethod(`${global.apiurl}bargains/getMpData?bargainId=${_this.dataInfo.bargainId}`,
          res => {
            resolve(res);
          },
          failRes => {
            reject(failRes)
          }
        )
      })
    },
    // 砍价跳转
    handleClickBargainDetail(bargainId) {
      if (this.dataInfo.status == 1) {
        this.$showCjToast({
          text: '活动未开始，暂不能砍价！',
          type: 'warn'
        });
        return;
      }
      this.checkUserIsFollowedMp().then(res => {
        if (res.threshold == 2 && res.isFollowedMp == 0) {
          this.mpQrcode = res.mpQrcode;
          this.showAccountQcode = true;
          return;
        }
        if (this.bindPhoneSetting && this.bindPhoneSetting.buyBind) {
          if (utilJs.goBindMobile()) return;
        }
        if (this.dataInfo.status == 2) {
          this.$routerGo(this, "push", {
            path: "/homePage/bargain/bargainDetail",
            query: {
              bargainId: bargainId
            }
          });
        }
      })
    },
    // 显示商品详细信息
    getGoodsDetail() {
      this.isShowGoodsDetail = true;
    },
    //活动海报
    invitePoster: function () {
      if (this.bindPhoneSetting && this.bindPhoneSetting.shareBind) {
        if (utilJs.goBindMobile()) return;
      }
      let ckFrom = this.vipInfo.vipType == 2 ? global.ckFrom.vip : global.ckFrom.svip;//this.ckFrom;
      let type = this.isCollage ? 3 : this.isSales ? 2 : this.isBargain ? 5 : 4;
      let cId = this.isFa ? this.dataInfo.faId : this.isCollage ? this.dataInfo.collageId : this.isBargain ? this.dataInfo.bargainId : this.dataInfo.pId;
      let proId = this.prodId;
      //把课程类型放到extId里面，目的是为了邀请卡的分享链接地址
      this.$routerGo(this, "push", { path: '/homePage/spread/spreadPoster', query: { cId: cId, type: type, ckFrom: ckFrom, vipType: this.vipInfo.vipType, isCollage: this.isCollage ? true : false, isSales: this.isSales ? true : false, isFa: this.isFa ? true : false, proId: proId } });
    },
    //助力详情
    goHelpDetail: function () {
      if (this.bindPhoneSetting && this.bindPhoneSetting.helpBind && utilJs.goBindMobile()) {
        return;
      }
      if (this.dataInfo.status == 2 || this.dataInfo.status == -2) {
        this.$showCjToast({
          text: `活动${this.dataInfo.status == 2 ? '未开始' : '已结束'}，暂不能助力领取！`,
          type: 'warn'
        });
        // 进行中&已领取
      } else if (this.dataInfo.status == 1 && this.dataInfo.takeStatus == 1) {
        this.$showCjToast({
          text: '每个活动只能参加一次！',
          type: 'warn'
        });
      } else {
        this.$routerGo(this, "push", {
          path: "/homePage/task/task",
          query: { 'faId': this.dataInfo.faId, 'refereeId': localStorage.getItem("userId") }
        });
      }
    },
    //友情灌溉倒计时
    friendTimeFn: function () {
      let time = '';
      if (this.dataInfo.status == 1) {
        time = this.dataInfo.endAt;
      } else if (this.dataInfo.status == 2) {
        time = this.dataInfo.startAt;
      }
      return time;
    },
    //友情灌溉倒计时结束修改状态
    friendFinishFn: function () {
      if (this.dataInfo.status == 2) {
        this.dataInfo.status = 1;
        this.friendTimeFn();
      } else if (this.dataInfo.status == 1) {
        this.dataInfo.status = -2;
      }
    },
    // // 限时购倒计时
    falshSalesTime(status) {
      if (this.dataInfo.sales) {
        this.dataInfo.sales.status = status
      } else if (this.isCollage) {
        this.dataInfo.status = status
      } else if (this.isBargain) {
        this.dataInfo.status = status
      }
    },
    // // 限时购倒计时结束
    finishFlashSales(status) {
      if (this.dataInfo.sales) {
        this.dataInfo.sales.status = status;
      } else if (this.isBargain) {
        this.getVipDetail();
      } else if (this.isFa) {
        if (status == -1) {
          // 此时的-1代表已结束
          this.dataInfo.status = status
        } else if (status == 2) {
          this.dataInfo.status = 1;
        }
      }
    },
    //拼团展示的倒计时
    timeFn: function () {
      let stime = this.dataInfo ? utilJs.getTimeByDate(this.dataInfo.startTime) : 0;
      let etime = this.dataInfo ? utilJs.getTimeByDate(this.dataInfo.endTime) : 0;
      let nowTime = (new Date()).getTime();
      //.collage.status 1未开始,2进行中,3已结束,4已停止
      let time = '';
      if (stime > nowTime) {
        this.dataInfo.status = 1;
        time = this.dataInfo.startTime;
      } else if (etime > nowTime) {
        this.dataInfo.status = 2;
        time = this.dataInfo.endTime;
      }
      return time;
    },
    //倒计时结束后修改状态
    finishFn: function () {
      if (this.dataInfo.status == 1) {
        this.dataInfo.status = 2;
        this.timeFn();
      } else {
        this.dataInfo.status = 3;
      }
    },
    //获取可以领取的优惠券
    getCouponList: function () {
      if (!this.couponLoading) {
        this.couponLoading = true;
        let $this = this;
        utilJs.getMethod(`${global.apiurl}redeemCodes/getCouponsByRedeemType?courseId=${this.prodId}&redeemType=${this.redeemType}&limit=10&page=${this.couponPage}`, function (res) {
          $this.couponLoading = false;
          $this.couponList = $this.couponList.concat(res.data);
          $this.couponPage = res.next_page_url ? ($this.couponPage + 1) : $this.couponPage;
          $this.couponIsPage = res.next_page_url ? true : false;
        },
          failRes => {
            $this.couponLoading = false;
          }
        );
      }
    },
    //跳转vip升级页面
    goVipUp: function () {
      let pathQuery = {
        prodId: this.vipInfo.cmpId || this.vipInfo.id,
        type: this.vipInfo.vipType == 2 ? this.cfrom.vip : this.cfrom.svip,
        recRelateId: this.$route.query.recRelateId,
        recType: this.$route.query.recType,
      };
      if (this.goodsRoomId) {
        pathQuery.goodsRoomId = this.goodsRoomId;
      }
      this.$routerGo(this, "push", {
        path: "/member/vip/vipBuy",
        query: pathQuery
      });
    },
    // 限购控制
    getSalesLimit() {
      let $this = this;
      utilJs.getMethod(`${global.apiurl}sales/getSalesLimit?pId=${this.dataInfo.pId}`, function (res) {
        $this.buyStatus = res.status;
        $this.limitSale = res.peopleLimit;
      });
    },
    //限时购立即抢购
    buyOnSales: function () {
      if (this.buyStatus == 1) {
        let st = utilJs.getTimeByDate(this.dataInfo.sales.startTime);
        let nt = (new Date()).getTime();
        if (st > nt) {
          return;
        }
        let pathQuery = {
          prodId: this.prodId,
          pId: this.dataInfo.pId,
          type: this.vipInfo.vipType == 2 ? this.cfrom.flashSalesVip : this.cfrom.flashSalesSvip,
          noGoVipUp: true,
          recRelateId: this.$route.query.recRelateId,
          recType: this.$route.query.recType,
        };
        if (this.goodsRoomId) {
          pathQuery.goodsRoomId = this.goodsRoomId;
        }
        this.$routerGo(this, "push", {
          path: "/member/vip/vipBuy",
          query: pathQuery
        });
      } else {
        this.$showCjToast({
          text: `每个人限购${this.limitSale}次`,
          type: 'warn'
        });
      }
    },
    gcd: function (cinfo) {
      this.goCollageDetail(cinfo.groupId, cinfo.collageId);
    },
    //跳转到拼团详情
    goCollageDetail: function (groupId, collageId) {
      if (this.dataInfo.userType != -1 && this.dataInfo.groupId != groupId) {
        this.$showCjToast({
          text: '您已在拼团中，不需要再去拼单啦！',
          type: 'warn'
        });
      } else {
        if (this.dataInfo.status == 1) {
          this.$showCjToast({
            text: '活动未开始，暂不能拼团！',
            type: 'warn'
          });
        } else {
          let pathQuery = {
            'groupId': groupId,
            'collageId': collageId,
            recRelateId: this.$route.query.recRelateId,
            recType: this.$route.query.recType
          };
          if (this.goodsRoomId) {
            pathQuery.goodsRoomId = this.goodsRoomId;
          }
          this.$routerGo(this, "push", {
            path: "/homePage/collage/collageDetail",
            query: pathQuery
          });
        }
      }
    },
    //跳转到拼团详情
    goBuy: function (groupId, collageId) {
      if (this.dataInfo.userType != -1 && this.dataInfo.groupId != groupId) {
        this.$showCjToast({
          text: '您已在拼团中，不需要再去拼单啦！',
          type: 'warn'
        });
      } else {
        if (this.dataInfo.status == 1) {
          this.$showCjToast({
            text: '活动未开始，暂不能拼团！',
            type: 'warn'
          });
        } else {
          //要加判断是否选择阶梯
          if (this.dataInfo.collage && this.dataInfo.collage.collageGroupType == 1 ) {
            this.$refs.collageGrades.goChoseBuy()
          } else {
            this.$refs.collageGrades.showBuy()
            // this.isShowBuy = true; //选择阶梯
          }
        }
      }
    },
    //获取vip活动详情
    getVipDetail: function () {
      let $this = this;
      if (this.isSales) { //限时购
        utilJs.getMethod(global.apiurl + "sales/getVipSalesDetail?prodId=" + this.prodId,
          function (res) {
            //后台停止限时购活动返回空数组
            if (JSON.stringify(res) === '[]') {
              $this.$routerGo($this, "replace", {
                path: "/error/emptyPage",
                query: {
                  from: "vipCollage",
                  info: "很抱歉，该限时购活动已停止"
                }
              });
            } else {
              $this.companyAuth = JSON.parse(localStorage.getItem("companyAuth"));
              $this.dataInfo = res;
              $this.vipInfo = res.vipInfo;
              $this.redeemType = res.vipInfo.vipType == 2 ? 39 : 40;
              $this.getCouponList();
              $this.cover = res.vipInfo.cover;
              $this.wechatShare();
              if (res.sales != null && (res.limit == 0 || res.balance > 0) && res.status && $this.companyAuth.enableFlashSalesModule == 1) {
                let nt = (new Date()).getTime();
                let st = utilJs.getTimeByDate(res.sales.startTime);
                let et = utilJs.getTimeByDate(res.sales.endTime);
                if (nt >= st && nt < et && res.sales.status > -1) {
                  // this.ckFrom = global.ckFrom.flashSalesColumn;
                  res.sales.status = 2;
                  $this.getSalesLimit();
                } else if (nt < st && res.sales.status == 1) {
                  // this.ckFrom = global.ckFrom.flashSalesColumn;
                  res.sales.status = 1;
                } else if (nt >= et && res.sales.status == 2) {
                  res.sales.status = -1;
                  $this.dataInfo.sales = null;
                  let that = $this;
                  $this.$showCjToast({
                    text: "该限时购已结束",
                    type: 'warn',
                  }).then(() => {
                    that.$routerGo(that, "replace", { path: "/" });
                  });
                } else {
                  $this.dataInfo.sales = null;
                  let that = $this;
                  $this.$showCjToast({
                    text: "该限时购已结束",
                    type: 'warn',
                  }).then(() => {
                    that.$routerGo(that, "replace", { path: "/" });
                  });;
                }
              } else {
                let that = $this;
                if (res.limit != 0 && res.balance <= 0) {
                  $this.$showCjToast({
                    text: "该商品已售罄",
                    type: 'warn',
                  }).then(() => {
                    that.$routerGo(that, "replace", { path: "/" });
                  });;
                } else {
                  $this.$showCjToast({
                    text: "该限时购已结束",
                    type: 'warn',
                  }).then(() => {
                    that.$routerGo(that, "replace", { path: "/" });
                  });;
                }
              }
              $this.getEquityDetail($this.vipInfo.vipType == 2 ? $this.cfrom.vip : $this.cfrom.svip);
            }
          }
        );
      } else if (this.isFa) { //友情灌溉
        utilJs.getMethod(`${global.apiurl}friendHelpers/${this.prodId}/getHelpVipDetail`,
          function (res) {
            //后台停止友情灌溉活动返回空数组
            if (JSON.stringify(res) === '[]') {
              $this.$routerGo($this, "replace", {
                path: "/error/emptyPage",
                query: {
                  from: "vipCollage",
                  info: "很抱歉，该友情灌溉活动已停止"
                }
              });
            } else {
              $this.isChainProd = res.isChainProd
              $this.companyAuth = JSON.parse(localStorage.getItem("companyAuth"));
              $this.dataInfo = res;
              $this.vipInfo = res.vipInfo;
              $this.cover = res.cover;
              $this.wechatShare();
              $this.getEquityDetail($this.dataInfo.vipType == 2 ? $this.cfrom.vip : $this.cfrom.svip);
            }
          }
        );
      } else if (this.isBargain) {
        // 砍价
        utilJs.getMethod(global.apiurl + "bargains/getVipBargainDetail?prodId=" + this.prodId,
          function (res) {
            if (res.status == 1 && res.isPreheatStart == 0 ) {
              $this.$routerGo($this, "replace", {
                path: "/error/emptyPage",
                query: {
                  from: "vipCollage",
                  info: "很抱歉，该砍价活动未开始"
                }
              });
              return;
            }
            //后台停止砍价活动返回空数组
            if (JSON.stringify(res) === '[]') {
              $this.$routerGo($this, "replace", {
                path: "/error/emptyPage",
                query: {
                  from: "vipCollage",
                  info: "很抱歉，该砍价活动已停止"
                }
              });
            } else {
              $this.companyAuth = JSON.parse(localStorage.getItem("companyAuth"));
              $this.dataInfo = res;
              $this.vipInfo = res.vipInfo;
              $this.cover = res.vipInfo.cover;
              $this.wechatShare();
              if ($this.dataInfo.status >= 2 && $this.dataInfo.userType != -1 && $this.dataInfo.payStatus == 2) {
                $this.$cjConfirm({
                  title: '提示',
                  message: '您已经有此活动的权限啦，去查看你的权限吧！',
                  showCancelButton: false,
                  clickCloseModal: false,
                  onConfirm:() => {
                    $this.$routerGo($this, "push", {
                      path: "/member/vip/vipUp"
                    });
                  }
                })
              }
              $this.getEquityDetail($this.dataInfo.prodType == $this.cfrom.vip ? $this.cfrom.vip : $this.cfrom.svip);
            }
          }
        );
      } else { //拼团
        utilJs.getMethod(global.apiurl + "collage/getVipCollageDetail?prodId=" + this.prodId,
          function (res) {
            //后台停止拼团活动返回空数组
            if (JSON.stringify(res) === '[]') {
              $this.$routerGo($this, "replace", {
                path: "/error/emptyPage",
                query: {
                  from: "vipCollage",
                  info: "很抱歉，该拼团活动已停止"
                }
              });
            } else {
              $this.companyAuth = JSON.parse(localStorage.getItem("companyAuth"));
              $this.dataInfo = res;
              $this.dataInfo.collage = res;
              $this.vipInfo = res.vipInfo;
              $this.redeemType = res.vipInfo.vipType;
              $this.redeemType = res.vipInfo.vipType == 2 ? 39 : 40;
              $this.getCouponList();
              $this.cover = res.vipInfo.cover;
              $this.wechatShare();
              if ($this.dataInfo.status >= 2 && $this.dataInfo.userType != -1 && $this.dataInfo.payStatus == 2) {
                $this.$cjConfirm({
                  title: '提示',
                  message: '您已经有此活动的权限啦，去查看你的权限吧！',
                  showCancelButton: false,
                  clickCloseModal: false,
                  onConfirm:() => {
                    $this.$routerGo($this, "push", {
                      path: "/member/vip/vipUp"
                    });
                  }
                })
              }
              $this.getEquityDetail($this.dataInfo.prodType == $this.cfrom.collageVip || $this.dataInfo.prodType == $this.cfrom.vip ? $this.cfrom.vip : $this.cfrom.svip);
            }
          }
        );
      }
    },
    //是否永久会员
    isVipFoever() {
      let userInfo = this.dataInfo.userInfo;
      return ((userInfo && userInfo.svipEndTime && userInfo.svipEndTime.split(' ')[0] == '9999-12-31') || (userInfo && userInfo.vipEndTime && userInfo.vipEndTime.split(' ')[0] == '9999-12-31' && this.vipInfo && this.vipInfo.vipType == 2));
    },
    //分享
    wechatShare: function () {
      let shareDesc = '';
      let title = this.isCollage ? this.dataInfo.prodName : this.isBargain ? this.dataInfo.prodName : this.isSales ? this.vipInfo.prodName : this.dataInfo.name;
      if (this.isCollage) {
        title = `【邀您一起拼团】${title}`;
      } else if (this.isSales) {
        title = `【限时抢购】${title}`;
      } else if (this.isFa) {
        title = `【快来帮我灌溉吧】${title}`;
      } else if (this.isBargain) {
        title = `【邀您一起砍价】${title}`;
      }
      let shareImg = "";
      if (this.isSales) {
        shareImg = this.vipInfo.vipType == 2 ? 'https://kposshzcdn.ckjr001.com/admin/material/9_material_admin/image/public/i/wap/course/vip_sales.png' : 'https://kposshzcdn.ckjr001.com/admin/material/9_material_admin/image/public/i/wap/course/svip_sales.png';
      } else if (this.cover && this.cover.coverType == 2 && this.cover.coverUrl) {
        shareImg = this.cover.coverUrl;
      } else if (this.cover && this.cover.coverType == 1 && this.cover.coverUrl) {
        shareImg = `${window.location.protocol}//${window.location.hostname}/static/i/wap/vip/vip-bg-mb${this.cover.coverUrl}.png`;
      } else if (this.isBargain) {
        shareImg = this.dataInfo.prodType == this.cfrom.vip ? `(${window.location.protocol}//${window.location.hostname}/static/i/wap/course/vip.png)` : `(${window.location.protocol}//${window.location.hostname}/static/i/wap/course/svip.png)`;
      } else {
        shareImg = this.dataInfo.prodType == this.cfrom.collageVip ? `(${window.location.protocol}//${window.location.hostname}/static/i/wap/course/vip.png)` : `(${window.location.protocol}//${window.location.hostname}/static/i/wap/course/svip.png)`;
      }
      let typeUrl = this.isSales ? `&isSales=true` : this.isFa ? `&isFa=true` : this.isBargain ? `&isBargain=true` : ``;
      let shareUrl = `${window.location.href.split("#")[0]}#${this.$route.path}?prodId=${this.prodId}&refereeId=${localStorage.getItem("userId")}${typeUrl}`;
      if (this.isBargain) {
        shareDesc = this.dataInfo.shareDesc || "点击查看详情";
      } else {
        shareDesc = window.localStorage.getItem("shareDesc") || '点击查看详情';
      }
      utilJs.wechatConfig(shareUrl, title, shareImg, shareDesc, function () { });
    },
    //手机端分享
    appShare: function () {
      let shareDesc = '';
      let title = this.isCollage ? this.dataInfo.prodName : this.isBargain ? this.dataInfo.prodName : this.isSales ? this.vipInfo.prodName : this.dataInfo.name;
      if (this.isCollage) {
        title = `【邀您一起拼团】${title}`;
      } else if (this.isSales) {
        title = `【限时抢购】${title}`;
      } else if (this.isFa) {
        title = `【快来帮我灌溉吧】${title}`;
      } else if (this.isBargain) {
        title = `【邀您一起砍价】${title}`;
      }
      let shareImg = "";
      if (this.isSales) {
        shareImg = this.vipInfo.vipType == 2 ? 'https://kposshzcdn.ckjr001.com/admin/material/9_material_admin/image/public/i/wap/course/vip_sales.png' : 'https://kposshzcdn.ckjr001.com/admin/material/9_material_admin/image/public/i/wap/course/svip_sales.png';
      } else if (this.cover && this.cover.coverType == 2 && this.cover.coverUrl) {
        shareImg = this.cover.coverUrl;
      } else if (this.cover && this.cover.coverType == 1 && this.cover.coverUrl) {
        shareImg = `(${window.location.protocol}//${window.location.hostname}/static/i/wap/vip/vip-bg-mb${this.cover.coverUrl}.png)`;
      } else if (this.isBargain) {
        shareImg = this.dataInfo.prodType == this.cfrom.vip ? `(${window.location.protocol}//${window.location.hostname}/static/i/wap/course/vip.png)` : `(${window.location.protocol}//${window.location.hostname}/static/i/wap/course/svip.png)`;
      } else {
        shareImg = this.dataInfo.prodType == this.cfrom.collageVip ? `(${window.location.protocol}//${window.location.hostname}/static/i/wap/course/vip.png)` : `(${window.location.protocol}//${window.location.hostname}/static/i/wap/course/svip.png)`;
      }
      let typeUrl = this.isSales ? `&isSales=true` : this.isFa ? `&isFa=true` : this.isBargain ? `&isBargain=true` : ``;
      let shareUrl = `${window.location.href.split("#")[0]}#${this.$route.path}?prodId=${this.prodId}&refereeId=${localStorage.getItem("userId")}${typeUrl}`;
      if (this.isBargain) {
        shareDesc = this.dataInfo.shareDesc || "点击查看详情";
      } else {
        shareDesc = window.localStorage.getItem("shareDesc") || '点击查看详情';
      }
      utilJs.appShareTrue(title, shareImg, shareUrl, shareDesc);
    }
  },
  activated() {
    setDocumentTitle("特惠详情");// eslint-disable-line
    this.goodsRoomId = this.$route.query.goodsRoomId || '';
    this.prodId = this.$route.query.prodId;
    this.mkType = this.$route.query.mkType;
    this.isSales = this.$route.query.isSales ? true : false;
    this.isFa = this.$route.query.isFa ? true : false;
    this.isBargain = this.$route.query.isBargain ? true : false;
    this.recRelateId = this.$route.query.recRelateId || '',
    this.recType = this.$route.query.recType || '',
    this.isCollage = this.$route.query.isCollage || (!this.$route.query.isSales && !this.$route.query.isFa && !this.$route.query.isBargain) ? true : false;
    this.dataInfo = {};
    this.vipInfo = '';
    this.collageList = [];
    this.showCoupon = false;
    this.is_collagePage = false;
    this.couponLoading = false;
    this.collagePage = 1;
    this.couponPage = 1;
    this.redeemType = '';
    this.couponIsPage = false;
    this.buyStatus = 1;
    this.limitSale = 0;
    this.isShowGoodsDetail = false;
    this.cloroRGB = THEME_RGB_MAP[this.theme];
    this.equityDetail = [];
    this.isChainProd = false;
    this.isShowGoodsList = false;
    if (!this.isFa) {
      utilJs.getChainInfo(global.ckFrom.vip, this.prodId).then(res => {
        this.isChainProd = res && res.isChainProd;
      });
    }
    getBindPhoneSetting(global.ckFrom.vip).then(res => {
      this.bindPhoneSetting = res;
    });
    this.getVipDetail();
  },
  deactivated() { }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.vip-circle {
  width: 0.2rem;
  height: 0.2rem;
  border-radius: 50%;
  display: inline-block;
}
.icon-vip34 {
  width: 0.85rem;
  height: 0.85rem;
}
.translate-lr {
  position: absolute;
  left: 50%;
  transform: translate(-50%, 0);
}
.knowBtn {
  background: linear-gradient(
    -90deg,
    rgba(72, 147, 248, 1),
    rgba(72, 147, 248, 0.7)
  );
}
.goodsDetail >>> img {
  width: 100%;
}
.goodsDetail >>> p {
  width: 100%;
  white-space: pre-wrap;
  white-space: -moz-pre-wrap;
  white-space: -pre-wrap;
  white-space: -o-pre-wrap;
  word-wrap: break-word;
  color: #666666;
  font-size: 0.6rem;
  line-height: 1.2rem;
}
.goodsDetail >>> span {
  width: 100%;
  white-space: pre-wrap;
  white-space: -moz-pre-wrap;
  white-space: -pre-wrap;
  white-space: -o-pre-wrap;
  word-wrap: break-word;
  color: #666666;
  font-size: 0.6rem;
  line-height: 1.2rem;
}
.box-shadow{
  box-shadow:0px 0px 10px -2px rgba(0, 0, 0, 0.5);
}
.dialog-mid {
  background: url("../../../assets/i/wap/vip/vip-good-middle.png") repeat-y;
  background-size: 100% auto;
  /* padding-right: 0.4rem; */
}
.dialog-bottom {
  height: 5.25rem;
  background: url("../../../assets/i/wap/vip/vip-good-bottom.png") no-repeat;
  background-size: 100% 100%;
}
</style>
